//
//  CrazyChatGoodsLinkCell.m
//  webSocket
//
//  Created by 马军凯 on 2019/1/18.
//  Copyright © 2019年 ZH. All rights reserved.
//

#import "CrazyChatGoodsLinkCell.h"

@implementation CrazyChatGoodsLinkCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = CRAZY_RGBR(229);
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setLayoutView];
    }
    return self;
}

- (void)setLayoutView {
    //背景
    UIView *allBackView = [[UIView alloc] init];
    allBackView.frame = CGRectMake(10, 10, CRAZY_SCREEN_WIDTH - 20, 100);
    allBackView.backgroundColor = [UIColor whiteColor];
    [allBackView corner_radius:10];
    [self.contentView addSubview:allBackView];
    self.allBackView = allBackView;
    //图片
    UIImageView *picImageView = [[UIImageView alloc] init];
    picImageView.frame = CGRectMake(5, 5, 60, 60);
    picImageView.image = [UIImage imageNamed:@"Crazy_chat_photo@2x.png"];
    [self.allBackView addSubview:picImageView];
    self.picImageView = picImageView;
    //标题
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.frame = CGRectMake(70, 5, self.allBackView.width - 80, 20);
    titleLabel.text = @"标题";
    titleLabel.textColor = CRAZY_RGBR(33);
    titleLabel.font = [UIFont systemFontOfSize:15];
    [self.allBackView addSubview:titleLabel];
    self.titleLabel = titleLabel;
    //价格
    UILabel *priceLabel = [[UILabel alloc] init];
    priceLabel.frame = CGRectMake(70, 45, self.allBackView.width - 80, 20);
    priceLabel.textColor = CRAZY_BACK_COLOR;
    priceLabel.text = @"￥159.00";
    priceLabel.font = [UIFont systemFontOfSize:15];
    [self.allBackView addSubview:priceLabel];
    self.priceLabel = priceLabel;
    //发送按钮
    UIButton *sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    sendBtn.frame = CGRectMake(self.allBackView.width / 2 - 55, 70, 110, 25);
    [sendBtn setTitle:@"发送宝贝链接" forState:UIControlStateNormal];
    [sendBtn setTitleColor:CRAZY_BACK_COLOR forState:UIControlStateNormal];
    [sendBtn px_border:0.5 color:CRAZY_BACK_COLOR];
    [sendBtn corner_radius:sendBtn.height / 2];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:13];
    [self.allBackView addSubview:sendBtn];
    self.sendBtn = sendBtn;
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
